package wzc.design_pattern.behaviour.iterator;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author 那和不是个啥
 * @Date 2025/7/20
 * @Description
 */

public class BookShelf {
    private List<Book> books = new ArrayList<Book>();

    public void addBook(Book book) {
        books.add(book);
    }

    public Iterator<Book> iterator() {
        return new BookShelfIterator(books);
    }
}
